<template>
  <div class="container">
    <div>
      <el-row :gutter="20">
        <el-col :span="6">
          <el-form ref="form" :model="form">
            <el-form-item label="开始日期：">
              <el-date-picker
                v-model="STARTDATE"
                type="date"
                placeholderb
                filterable="选择日期"
                value-format="yyyy-MM-dd"
              ></el-date-picker>
            </el-form-item>
            <el-form-item label="结束日期：">
              <el-date-picker
                v-model="ENDDATE"
                type="date"
                placeholderb
                filterable="选择日期"
                value-format="yyyy-MM-dd"
              ></el-date-picker>
            </el-form-item>
          </el-form>
        </el-col>
        <el-col :span="6">
          <el-form ref="form" :model="form">
            <el-form-item label="考核单位：">
              <el-select v-model="DW" placeholder="请选择">
                <el-option
                  v-for="item in unitData"
                  :key="item.CLIENT_NO"
                  :label="item.UNITNAME"
                  :value="item.CLIENT_NO"
                >
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="考核项目：">
              <el-select v-model="XM" placeholder="请选择">
                <el-option
                  v-for="item in itemData"
                  :key="item.ID"
                  :label="item.ITEMNAME"
                  :value="item.ID"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-form>
        </el-col>
        <el-col :span="6">
          <el-form ref="form" :model="form">
            <el-form-item label="考核类型：">
              <el-select v-model="LX" placeholder="请选择">
                <el-option
                  v-for="item in typeData"
                  :key="item.ID"
                  :label="item.TYPENAME"
                  :value="item.ID"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-form>
        </el-col>
        <el-col :span="4">
          <el-form ref="form" :model="form" style="float: left">
            <el-button size="mini" type="primary" @click="getInfoList"
              >查 询</el-button
            >
          </el-form>
        </el-col>
      </el-row>
    </div>
    <el-table
      highlight-current-row
      :data="
        originalData.slice((currentPage - 1) * pageSize, currentPage * pageSize)
      "
    >
      <el-table-column
        prop="TYPENAME"
        label="考核类型"
        align="center"
      ></el-table-column>
      <!-- <el-table-column
        prop="khbz"
        label="考核内容"
        align="center"
      ></el-table-column> -->
      <el-table-column
        prop="ITEMNAME"
        label="考核项目"
        align="center"
      ></el-table-column>
      <!-- <el-table-column
        prop="khdj"
        label="项目等级"
        align="center"
      ></el-table-column> -->
      <el-table-column
        prop="CREATENAME"
        label="创建单位"
        align="center"
      ></el-table-column>
      <el-table-column
        prop="AREANAME"
        label="考核单位"
        align="center"
      ></el-table-column>
      <el-table-column
        prop="WORKDATE"
        label="考核时间"
        align="center"
      ></el-table-column>
      <el-table-column
        prop="CREATETIME"
        label="创建日期"
        align="center"
      ></el-table-column>
      <!-- <el-table-column
        prop="zdxtj"
        label="针对性条件"
        align="center"
      ></el-table-column> -->
      <!-- <el-table-column
        prop="cy"
        label="抽样方式"
        align="center"
        width="200"
      ></el-table-column> -->

      <el-table-column label="考核内容" align="center">
        <template slot-scope="scope">
          <el-button type="text" @click="handleEdit(scope.$index, scope.row)"
            >详情</el-button
          >
          <el-button type="text" @click="handleEdit1(scope.$index, scope.row)"
            >下发</el-button
          >
          <!-- <el-button type="text" @click="handleEdit2(scope.$index, scope.row)"
            >考核结果补录</el-button
          > -->
        </template>
      </el-table-column>
    </el-table>
    <div class="pagination">
      <el-pagination
        background
        layout="total, sizes, prev, pager, next, jumper"
        :current-page="currentPage"
        :page-size="pageSize"
        :total="originalData.length"
        @size-change="handleSizeChange"
        @current-change="handlePageChange"
      ></el-pagination>
    </div>
    <!-- 弹出框 -->
    <el-dialog title="考核任务下发" :visible.sync="isVisibleEdit1" width="30%">
      <el-form ref="form" :model="form">
        <el-form-item label="考核人员：" label-width="110px">
          <el-select v-model="form.RY" placeholder="请选择">
            <el-option
              v-for="item in workerData"
              :key="item.ID"
              :label="item.NAME"
              :value="item.ID"
            >
            </el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="isVisibleEdit1 = false">取 消</el-button>
        <el-button type="primary" @click="handleSubmit()">确 定</el-button>
      </span>
    </el-dialog>

    <el-dialog title="考核任务详情" :visible.sync="isVisibleEdit" width="60%">
      <el-table :data="objectData">
        <el-table-column
          prop="NAME"
          label="考核对象"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="OBJECTTYPE"
          label="考核对象类型"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="RANDOMTYPE"
          label="抽样条件"
          align="center"
        ></el-table-column>
        <el-table-column prop="standard" label="考核标准" align="center"
          ><template slot-scope="scope">
            <el-tooltip
              class="item"
              effect="dark"
              :content="scope.row.CONTENT"
              placement="top"
            >
              <el-tag size="medium">{{ scope.row.standard }}</el-tag>
            </el-tooltip>
          </template></el-table-column
        >
        <el-table-column
          prop="POINT"
          label="分值"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="TIMELIMIT"
          label="整改时限"
          align="center"
        ></el-table-column>

        <!-- <el-table-column label="操作" align="center">
          <template slot-scope="scope">
            <el-button type="text" @click="handleEdit2(scope.$index, scope.row)"
              >考核结果补录</el-button
            >
          </template>
        </el-table-column> -->
      </el-table>
      <!-- <span slot="footer" class="dialog-footer">
        <el-button @click="isVisibleEdit = false">取 消</el-button>
        <el-button type="primary" @click="handleSubmit()">确 定</el-button>
      </span> -->
    </el-dialog>

    <!-- 考核结果补录弹出框 -->
    <el-dialog title="考核任务下发" :visible.sync="isVisibleEdit2" width="50%">
      <el-form ref="form" :model="details" label-width="80px">
        <el-form-item label="考核时间：">
          <el-date-picker
            v-model="details.WORKDATE"
            type="date"
            placeholderb
            filterable="选择日期"
            value-format="yyyy-MM-dd"
          ></el-date-picker>
        </el-form-item>

        <el-form-item label="扣分值:">
          <el-input
            v-model="details.POINT"
            placeholder="请输入"
            style="width: 14.4vw"
          ></el-input>
        </el-form-item>
        <el-form-item label="经度:">
          <el-input
            v-model="details.LNGITUDE"
            placeholder="请输入"
            style="width: 14.4vw"
          ></el-input>
        </el-form-item>
        <el-form-item label="纬度:">
          <el-input
            v-model="details.LATITUDE"
            placeholder="请输入"
            style="width: 14.4vw"
          ></el-input>
        </el-form-item>

        <el-form-item label="内容描述：" style="height: 3vw">
          <el-input
            type="textarea"
            maxlength="30"
            :autosize="{ minRows: 2 }"
            show-word-limit
            :rows="9"
            v-model="details.CONTENT"
            placeholder="请输入"
            class="handle-input mr10"
            style="width: 37.5vw; border: 1px solid #a4aca7"
          >
          </el-input>
        </el-form-item>

        <!-- <el-form-item label="图片：" style="height: 8vw; width: 100%">
          <el-button size="mini" type="success" @click="openFolder"
            >选择图片</el-button
          >
          <input
            type="file"
            ref="PicFile"
            style="display: none"
            accept="image/*"
            @change="uploadPic"
          />
          <el-upload
            :file-list="formPhoto.imageList"
            ref="PicUpload"
            list-type="picture-card"
            :on-remove="
              (file, fileList) => {
                handleRemovePic(file, fileList, index)
              }
            "
            style="margin: 10px 0"
          >
            <i slot="default" class="el-icon-picture-outline"></i>
          </el-upload>
        </el-form-item> -->
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="isVisibleEdit2 = false">取 消</el-button>
        <el-button type="primary" @click="handleSubmitP()">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import '@/assets/css/common.css'

import export2Excel from '@/utils/exportExcel/index.js'
import OSS from 'ali-oss';
import { formatDate } from '@/common/js/date.js'
export default {
  data () {

    return {
      STARTDATE: formatDate(new Date(new Date().getTime() - 3600 * 1000 * 24 * 30), 'yyyy-MM-dd'),
      ENDDATE: formatDate(new Date(new Date().getTime() + 3600 * 1000 * 24 * 30), 'yyyy-MM-dd'),
      typeData: [],
      unitData: [],
      itemData: [],
      DW: '',
      XM: '',
      LX: '',
      checkList3: '是',
      clientData: [],
      currentPage: 1, //初始页
      pageSize: 10,    //    每页的数据
      originalData: [],
      tableData: [],
      workerData: [],
      objectData: [],
      select: {
        CPH: ''
      },
      isVisibleEdit: false,
      isVisibleEdit1: false,
      isVisibleEdit2: false,
      input: 1,
      inputPlaceholder: '请输入数量',
      queryType: '',
      labelwidth: 100,
      addDialogTitle: '',
      form: {
        DW: '',
        RY: '',
        ID: '',
      },
      details: {
      },
      contentTags: ['道路机扫-道路', '环卫作业公司', '公厕'],
      contentTags2: ['考核覆盖率', '黑名单', '上次考核不达标'],
      conditionTags: ['按数量抽取', '按比例抽取', '按地图绘制范围'],
      inputVisible: false,
      inputValue: '',
      isRandom: false,
      isRandomInput: '',
      //图片上传

      formPhoto: {
        imageList: []
      },
      fileList: [],
      PicUrl: '', //存上传后的照片url
      dataObj: {
        region: 'oss-cn-beijing',//我的存储是北京，可根据具体配置自行修改
        accessKeyId: 'LTAISI12uxTRFccz',
        accessKeySecret: 'cQAvLIZ9JizT5RXRNPBVcXfg3iURD8',
        bucket: 'photo-srw-hb2',
      }, //存签名信息
      baseAli: 'oss-cn-beijing.aliyuncs.com',
    }
  },
  created () {
  },
  mounted () {
    this.getUnitList()
    this.getTypeList()
    this.getItemList()
    this.getInfoList()
  },
  methods: {
    // 获取考核单位列表
    async getUnitList () {
      var url = 'Assess/GetUnit_Assess?UNITNAME='
      let { data } = await this.$Http.get(url)
      this.unitData = data
    },
    // 获取考核类型列表
    async getTypeList () {
      var url = 'Assess/GetCheckType_Assess?TYPENAME='
      let { data } = await this.$Http.get(url)
      this.typeData = data
    },
    // 获取考核项目列表
    async getItemList () {
      var url = 'Assess/GetCheckItem_Assess?KEY='
      let { data } = await this.$Http.get(url)
      this.itemData = data
    },
    // 获取考核任务列表
    async getInfoList () {
      var url = 'Assess/GetTaskList_Assess?CLIENT_NO=' + localStorage.getItem('CLIENT_NO') + '&StartTime=' + this.STARTDATE
        + '&EndTime=' + this.ENDDATE + '&CHECKAREA=' + this.DW + '&CHECKITEM=' + this.XM + '&CHECKTYPE=' + this.LX
      let { data } = await this.$Http.get(url)
      this.originalData = data
    },
    // 获取考核内容详情
    async getObjectList (row) {
      var url = 'Assess/GetItemObjectByID_Assess?CLIENT_NO=' + localStorage.getItem('CLIENT_NO')
        + '&ITEMID=' + row.CHECKITEMID + '&OBJECTTYPE=' + row.CHECKOBJECTTYPEID + '&IDS=' + row.OBJECTIDS
      let { data } = await this.$Http.get(url)
      data.forEach(element => {
        element.OBJECTTYPE = row.OBJECTTYPE
        element.RANDOMTYPE = row.RANDOMTYPE
        element.standard = this.standardData[0].TITLE
        element.CONTENT = this.standardData[0].CONTENT
        element.POINT = this.standardData[0].POINT
        element.TIMELIMIT = this.standardData[0].TIMELIMIT
      })
      this.objectData = data
      this.isVisibleEdit = true;
    },
    // 获取考核标准详情
    async getStandardList (row) {
      var url = 'Assess/GetStandardByBHS_Assess?BHS=' + row.STANDARDIDS
      let { data } = await this.$Http.get(url)
      this.standardData = data
      this.getObjectList(row)
    },
    // 获取分派任务人员
    async getTaskWorkerList () {
      var url = 'Assess/GetNoTaskWorker_Assess?CLIENT_NO=' + this.form.CLIENT_NO + '&TASKID=' + this.form.ID
      let { data } = await this.$Http.get(url)
      this.workerData = data
    },
    // getlistdataAssess () {
    handleEdit (index, row) {
      this.form = Object.assign({}, row);
      this.addDialogTitle = '考核内容详情'
      this.getStandardList(row)
    },
    handleEdit1 (index, row) {
      console.log(row)
      this.form = Object.assign({}, row);
      // console.log(this.form)
      this.isVisibleEdit1 = true;
      this.getTaskWorkerList()
    },
    handleEdit2 (index, row) {
      console.log(row)
      this.details = Object.assign({}, row);
      this.isVisibleEdit2 = true;
      this.getTaskWorkerList()
    },
    // 下发任务
    async handleSubmit () {
      this.$axios({
        url: 'Assess/SaveTaskWorker_Assess',
        method: 'get',
        params: {
          ID: this.form.ID,
          CHECKCLIENT_NO: this.form.CLIENT_NO,
          WORKID: this.form.RY,
        },

      }).then((res) => {
        if (res.data.IsSucess) {
          this.$message.success('下发成功');
          this.isVisibleEdit1 = false;
          this.getInfoList()
        } else {
          this.$message.error('下发失败');
        }
      })
    },
    // 结果补录
    async handleSubmitP () {
      this.$axios({
        url: 'Assess/SaveResult_Assess',
        method: 'post',
        data: {
          WORKDATE: this.details.WORKDATE,
          TASKID: this.form.ID,
          OBJECTID: this.details.ID,
          STANDARDID: this.form.STANDARDIDS,
          POINT: this.details.POINT,
          CONTENT: this.details.CONTENT,
          PHOTO: '',
          AUDIO: '',
          VEDIO: '',
          LNGITUDE: this.details.LNGITUDE,
          LATITUDE: this.details.LATITUDE,
        },

      }).then((res) => {
        if (res.data.IsSucess) {
          this.$message.success('补录成功');
          this.isVisibleEdit2 = false;
          this.getInfoList()
        } else {
          this.$message.error('补录失败');
        }
      })
    },
    screenAssess (checkList2, array) {
      checkList2.forEach(element => {
        var arrayReturn = []
        array.forEach(item => {
          if (item.assess === element) {
            arrayReturn.push(item)
          }
        });
        if (this.isRandom) {
          switch (this.isRandomInput.split(":")[0]) {

            case '按数量抽取':
              {
                var count = this.isRandomInput.split(":")[1]
                this.tableData = this.tableData.concat(arrayReturn.slice(0, count))
              }
              break;
            case '按比例抽取':
              {
                var count = this.isRandomInput.split(":")[1]
                count = count * arrayReturn.length / 100
                this.tableData = this.tableData.concat(arrayReturn.slice(0, count))
              }
              break;
            case 4:
              {
                var count = Math.ceil(Math.random() * 10) + 5;
                this.tableData = this.tableData.concat(arrayReturn.slice(0, count))
              }
              break;
          }
        } else {
          this.tableData = this.tableData.concat(arrayReturn)
        }
      });
    },
    changeHandler () {

    },
    handleClose (tag) {
      this.contentTags.splice(this.contentTags.indexOf(tag), 1);

    },
    handleClose1 (tag) {
      this.conditionTags.splice(this.conditionTags.indexOf(tag), 1);
    },

    showInput () {
      this.inputVisible = true;
      this.$nextTick(_ => {
        this.$refs.saveTagInput.$refs.input.focus();
      });
    },

    handleInputConfirm () {
      let inputValue = this.inputValue;
      if (inputValue) {
        this.contentTags.push(inputValue);
      }
      this.inputVisible = false;
      this.inputValue = '';
    },
    handleInputConfirm1 () {
      let inputValue = this.inputValue;
      if (inputValue) {
        this.conditionTags.push(inputValue);
      }
      this.inputVisible = false;
      this.inputValue = '';
    },

    // 导入Excel
    onChange (file, fileList) {
      //  console.log(fileList);
      this.fileData = file; // 保存当前选择文件
      this.readExcel(); // 调用读取数据的方法
    },
    // 读取数据
    readExcel (e) {
      let that = this;
      const files = that.fileData;
      console.log(files);
      if (!files) {
        //如果没有文件
        return false;
      } else if (!/\.(xls|xlsx)$/.test(files.name.toLowerCase())) {
        this.$message.error("上传格式不正确，请上传xls或者xlsx格式");
        return false;
      }
      const fileReader = new FileReader();
      console.log(fileReader)
      fileReader.onload = ev => {
        try {
          const data = ev.target.result;
          //  console.log(ev.target)
          //  console.log(this);
          const workbook = this.XLSX.read(data, {
            type: "binary"// 以字符编码的方式解析
          });

          if (workbook.SheetNames.length >= 1) {
            //  this.$message({
            //    message: "导入数据表格成功",
            //    showClose: true,
            //    type: "success"
            //  });

            const wsname = workbook.SheetNames[0]; //取第一张表
            const ws = this.XLSX.utils.sheet_to_json(workbook.Sheets[wsname]); //生成json表格内容
            console.log(ws)
            this.inputExcelDataLength = ws.length
            this.fullscreenLoading = this.$loading({
              lock: true,
              text: 'Loading',
              spinner: 'el-icon-loading',
              background: 'rgba(0, 0, 0, 0.7)'
            })
            for (let i = 0, len = ws.length; i < len; i++) {
              var item = ws[i]
              //   var sheetData = {
              //     VID: item['居民电话'],
              //     RUBBISH_NAME: item["垃圾品名"],
              //     WEIGHT: item["垃圾称重"],
              //     photo: '',
              //     LONGITUDE: 0,
              //     LATITUDE: 0
              //   }
              //   let exceldata =  []
              //   exceldata.push(sheetData)
              this.addWeight(item)
            }
          } else {
            this.$message.error("未读取到表格内容");
          }
        } catch (e) {
          return false;
        }
      };
      // 如果为原生 input 则应是 files[0]
      fileReader.readAsBinaryString(files.raw);
    },
    async addWeight (item) {
      this.$axios({
        url: 'CarService/AddCarAddWaterInfo',
        method: 'post',
        data: {
          WaterCPH: item['车牌照号'],
          WaterTime: item['加水时间'],
          CreateTime: item['上传时间'],
          WaterNumber: item['加水量（吨）'],
          WaterLocation: item['加水地点'],
          WaterCphType: item['加水类型'],
          WaterPeople: item['加水人员'],
          WaterPeopleID: item['加水人员编号'],
        }
      }).then(res => {
        console.log(res)
        this.inputExcelDataIndex++

        if (res.data.IsSucess) {
          this.fullscreenLoading.close()
          this.$message.success('表格文件导入成功')
          this.getlistdata()
        } else {
          this.fullscreenLoading.close()
          this.$message.error('表格文件导入失败' + '，' + res.data.Message);

        }
        if (this.inputExcelDataIndex == this.inputExcelDataLength) {
          this.fullscreenLoading.close()
          if (this.strError.length == 0) {
            this.$message.success('表格文件导入成功')
          } else {
            // this.$message.error('表格文件导入结束<br/>' + this.strError);
            this.$message({
              message: '表格文件导入结束，' + this.strError,
              type: 'error',
              duration: 5000
            })
          }
          this.getlistdata()
        }
      })
      //   })
    },
    // 导出Excel
    exportExcel () {
      let excelName = '车辆加水记录'
      const tHeader = ['加水记录编号', '车牌照号', '加水时间', '上传时间', '加水量（吨）', '加水地点', '加水类型', '加水人员', '加水人员编号']
      const filterVal = ['ID', 'WaterCPH', 'WaterTime', 'CreateTime', 'WaterNumber', 'WaterLocation', 'WaterCphType', 'WaterPeople', 'WaterPeopleID']
      export2Excel(tHeader, filterVal, this.tableData, excelName)
    },
    // 打开新增窗口
    handleAdd () {
      this.addDialogTitle = '新增车辆加水信息'
      //清空编辑框
      this.form = {
        WaterCPH: "",
        WaterTime: "",
        CreateTime: "",
        WaterNumber: "",
        WaterLocation: "",
        WaterCphType: "",
        WaterPeople: "",
        WaterPeopleID: "",
      }
      //展示窗口
      this.isVisibleEdit = true;
      // this.idEdit = false;
    },


    // 模糊查询
    screeningData () {
      this.tableData = this.originalData
      if (this.select.CPH) this.tableData = this.tableData.filter(item => item.CPH.includes(this.select.CPH))
    },
    // 分页导航
    handlePageChange (currentPage) {
      this.currentPage = currentPage;
      // console.log(this.currentPage)
      // this.$set(this.query, 'pageIndex', val);
      // this.getlistdata();
    },
    handleSizeChange (size) {
      this.pageSize = size;
      console.log(this.pageSize)
    },

    // 限制用户上传的图片格式和大小
    beforeAvatarUpload (file) {
      const isJPG = file.type === 'image/jpeg';
      const isLt2M = file.size / 1024 / 1024 < 2
      if (!isJPG) {
        this.$message.error('上传头像图片只能是 JPG 格式!');
      }
      if (!isLt2M) {
        this.$message.error('上传头像图片大小不能超过 2MB!');
      }
      return isJPG && isLt2M;
    },
    // 点击上传维修单图片按钮
    clickBYFJPic () {
      this.$refs.BYFJPicFile.click();
    },
    changeBYFJPic () {
      this.afterRead(this.$refs.BYFJPicFile.files[0]);
      this.$refs.BYFJPicFile.value = null; // 移除文件，可以保证上传同样的文件时，也会触发change事件
    },
    afterRead (file) {
      return new Promise((resolve, reject) => {
        // 此时可以自行将文件上传至服务器
        const that = this
        let client = new OSS(this.dataObj)
        const fileName = file.name
        //定义唯一的文件名，打印出来的uid其实就是时间戳
        //client 是第一步中的 client
        client
          .multipartUpload(fileName, file)
          .then((result) => {
            //下面是如果对返回结果再进行处理，根据项目需要
            // console.log(result)
            that.PicUrl =
              'http://' +
              result.bucket +
              '.' +
              that.baseAli +
              '/' +
              result.name
            console.log(that.tempUrl)
            resolve()
          })
          .catch((err) => {
            console.log('err:', err)
            reject()
          })
      })
    },
    handleAvatarSuccess (res, file) {
      this.imageUrl = URL.createObjectURL(file.raw)
    },

    openFolder () {
      if (this.formPhoto.imageList.length > 2) {
        this.$message.warning(`最多上传三张图片`);
      } else {
        this.$refs.PicFile.click();
      }
    },
    uploadPic () {
      this.readPic(this.$refs.PicFile.files[0]);
      this.$refs.PicFile.value = null; // 移除文件，可以保证上传同样的文件时，也会触发change事件
    },
    readPic (file) {
      return new Promise((resolve, reject) => {
        // 此时可以自行将文件上传至服务器
        const that = this
        let client = new OSS(this.dataObj)
        const fileName = file.name
        //定义唯一的文件名，打印出来的uid其实就是时间戳
        //client 是第一步中的 client
        client
          .multipartUpload(fileName, file)
          .then((result) => {
            //下面是如果对返回结果再进行处理，根据项目需要
            // console.log(result)
            var url =
              'https://' +
              result.bucket +
              '.' +
              that.baseAli +
              '/' +
              result.name
            console.log(url)
            that.completeUploadPic(result.name, url)
            resolve()
          })
          .catch((err) => {
            console.log('err:', err)
            reject()
          })
      })
    },
    completeUploadPic (name, url) {
      this.formPhoto.imageList.push({ name: name, url: url })
    },
    // 删除图片
    handleRemovePic (file, fileList, index) {
      // console.log('删前')
      // console.log(this.formPhoto.imageList)
      this.formPhoto.imageList.splice(this.formPhoto.imageList.indexOf(file), 1);
      // console.log('删后')
      // console.log(this.formPhoto.imageList)
    },
    // 放大图片
    handlePreviewPic (file) {
      this.dialogImageUrl = file.url;
      this.dialogVisible = true;
    },
    // 关闭图片编辑窗口
    handleClosePic () {
      this.$refs.PicUpload.clearFiles()
    },
    // 关闭图片预览窗口
    handleClosePicPreview () {
      this.$nextTick(() => {
        let domImageMask = document.querySelector(".el-image-viewer__mask");
        if (domImageMask) {
          domImageMask.addEventListener("click", () => {
            document.querySelector(".el-image-viewer__close").click();
          })
        }
      })
    },
  }
}
</script>
<style>
.el-form-item__label {
  text-align: left;
}
/* .el-checkbox {
  color: #fff;
}
.el-checkbox__label {
  color: #fff !important;
} */
.content {
  overflow-y: scroll;
}
.el-col-6 {
  width: 350px;
  min-height: 50px;
}
.el-table th {
  height: 40px;
}
.el-form-item label {
  width: 80px;
}
.el-tag + .el-tag {
  margin-left: 10px;
}
.button-new-tag {
  margin-left: 10px;
  height: 32px;
  line-height: 30px;
  padding-top: 0;
  padding-bottom: 0;
}
.input-new-tag {
  height: 32px;
  line-height: 30px;
  width: 90px;
  margin-left: 10px;
  vertical-align: bottom;
}
.aroundtop {
  padding: 10px;
  background-color: #007acc;
  height: 100%;
  border-radius: 5px;
}
.el-icon-speed {
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  height: 30px;
  line-height: 28px;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  margin: 10px 20px 10px 20px;
}
</style>